package com.example.account.controller;

import com.example.account.api.AccountApi;
import com.example.account.client.StorageClient;
import com.example.account.service.AccountService;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AccountController implements AccountApi {

    @Autowired
    private AccountService accountService;

    @Autowired
    private StorageClient storageClient;

    @Override
    public Boolean debit(String userId, int money) {
        Boolean result = accountService.debit(userId, money);
        return result;
    }
}
